﻿Write-Host ("   Configuring Developer Dashboard ({0})..." -f [DateTime]::Now.ToString())

if ((Get-PSSnapin -Name  Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null) 
{ 
    Add-PsSnapin  Microsoft.SharePoint.PowerShell 
}

#values: On, Off, OnDemand
$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService 
$contentService.DeveloperDashboardSettings.DisplayLevel = "OnDemand" 
$contentService.DeveloperDashboardSettings.Update() 